In an electronic control unit (ECU) mounted on a vehicle, it is necessary in its control program to execute predetermined processing in a real-time manner for ensuring control response, safety and the like. For this purpose, programs are defined for tasks with priorities. More particularly, plural programs as execution units are separately defined as a program belonging to a high priority task, a program belonging to an intermediate priority task, a program belonging to a low priority task, and the like. By this definition, execution priority is substantially set for each program, and selection is performed in task units and executing the corresponding program, thereby a relatively high-priority processing program is executed prior to (interrupting) a relatively low-priority processing program, and real-time execution is ensured.
A problem occurs when a series of data requiring simultaneousness is handled in a program (lower-order program) which may be interrupted by another program (higher-order program). Such a case may occur, for example, when three data P, Q and R are updated in the lower-order program. At this time, if the higher-order program interrupts the lower-order program in a status where only the data P is updated and then the three data P, Q and R are referred to, only the data P is updated but the remaining data Q and R are not updated. Thus, a status occurs in which simultaneousness is unensured.
Accordingly, the interrupt processing by a higher-order program is inhibited during a period in which a series of data is handled by a lower-order program, such that the data is not referred to by the higher-order program in the middle of the handling of the series of data. It is noted that the inhibition of interrupt processing in the present specification includes inhibition of task selection based on the task level, i.e., inhibition of a task dispatch, as well as inhibition of all the interrupt on the computer level.
However, if interrupt processing is inhibited, execution of high-order program which does not refer to a series of data as a subject of operation, i.e., program which does not cause any program even if it is executed, is uniformly inhibited. Accordingly, especially when there is a large amount of series of data as a subject of operation, as time of interrupt inhibition increases, execution of processing highly requiring real-time execution is delayed. Thus, the possibility of ill effect on control performance increases.
For example, as a series of data handling, initialization of failure code (DTC) or freeze frame data (FFD) can be given as an example. As a vehicle control program especially requires high reliability, the reliability is improved by providing the program with a self diagnostic function. That is, operation statuses of computer and sensors are automatically checked at appropriate periods, and upon occurrence of failure, the DTC as failure information or FFD as vehicle information upon occurrence of failure is stored in a nonvolatile memory such that a repair person or the like can obtain the content of the failure.
Regarding this diagnostic processing, it is required to realize service called “mode 04” for initializing stored DTC or FFD by legal regulation (OBD2). To realize this service, parameters of logic to perform failure detection must be initialized at the same time of initialization of the DTC or FFD stored in the nonvolatile memory, since the operation of the system becomes unstable if there is no consistency between the information and the parameters.
However, the number of failure detection subjects is presently about 200, and further it is increasing. Accordingly, an enormous number of data are subjects of initialization. In such a case, especially time of interrupt inhibition increases, and execution of processing highly requiring real-time execution is delayed. As a result, the possibility of unwanted effect on control performance increases.